<template>
		<view class="login">
			<view class="grid margin-bottom text-center col-1" >
				<view class="padding logo-box" style="margin-top: 300px;"></view>
			</view>
			
			<view class="cu-form-group">
				<view class="title">
					<text class='cuIcon-mobile text-grey'></text>
				</view>
				<input placeholder="请输入帐号" v-model="username" type="number" name="input">
			</view>
			
			<view class="cu-form-group">
				<view class="title">
					<text class='cuIcon-lock text-grey'></text>
				</view>
				<input placeholder="请输入密码" v-model="password" type="password" name="input">
			</view>	
			
			
			<view class="padding flex flex-direction" @tap="logins">
				<button class="cu-btn margin-tb-sm lg text-white" style="width: 220px;margin: 0 auto;background:linear-gradient(to right, #52FBF6, #06C7FE);font-weight: 600;"> 登 录 </button>
			</view>
			
			<view class="flex justify-center" @click="addXinbiList()">
				<view class="margin-xs text-grey text-lg">忘记密码？</view>
			</view>
			
		</view>
</template>

<script>
	export default {
		data() {
			return {
				username:'',
				password:'',
			}
		},
		methods: {
			logins() {
				console.log(this.username,this.password)
				if (this.username && this.password) {
					return this.User.login({
						url:"user/login",
						data:{
							username:this.username,
							password:this.password
						}
					})
				} else {
					uni.showToast({
						title: '请输入用户名与密码',
						duration: 2000,
						icon: "none"
					})
				}
			}
		},
		onLoad:function(options){
			console.log(options)
			uni.hideTabBar()
		}
	}
</script>

<style>
	.login{
		height: 100Vh;
		width: 100vw;
		background: #FFFFFF;
		background-image: url(../../static/background.png);
		background-repeat: no-repeat;
		background-size:100% 100%;
		-moz-background-size:100% 100%;
	}
	.cu-form-group{
		background: #FFF0F0;
		border-radius: 50upx;
		border:none;
		width: 230px;
		margin: 40upx auto;
		min-height: 80upx;
	}
	
</style>
